package com.venta.autopartes.user;

import java.util.ArrayList;
import java.util.List;

import com.venta.autopartes.branch.UserBranch;
import com.venta.autopartes.car.Address;
import com.venta.autopartes.utils.FormatUtility;

public class User implements Cloneable{
	private int userId;
	private String name;
	private String lastName;
	private String surName;
	private String email;
	private String birthDate;
	private Gender gender= new Gender();
	private String user;
	private String password;
	private String passwordConfirmation;
	private String lastLoginDate;
	private String imageURL;
	private String twitter;
	private String facebook;
	private String youtube;
	private PhoneContact phoneContact = new PhoneContact();
	private Address address = new Address();
	
	private User boss;
	private List<User> subordinates= new ArrayList<User>();
	private UserPrivilage userPrivilage=new UserPrivilage();
	private Answer answer=new Answer();
	private UserBranch userBranch = new UserBranch();
	
	
	public User() {
		super();
		// TODO Auto-generated constructor stub
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = FormatUtility.changeToUpperCase(name);
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = FormatUtility.changeToUpperCase(lastName);
	}

	public String getSurName() {
		return surName;
	}

	public void setSurName(String surName) {
		this.surName = FormatUtility.changeToUpperCase(surName);
	}
	

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getTwitter() {
		return twitter;
	}

	public void setTwitter(String twitter) {
		this.twitter = twitter;
	}

	public String getFacebook() {
		return facebook;
	}

	public void setFacebook(String facebook) {
		this.facebook = facebook;
	}

	public String getYoutube() {
		return youtube;
	}

	public void setYoutube(String youtube) {
		this.youtube = youtube;
	}

	public Answer getAnswer() {
		return answer;
	}

	public void setAnswer(Answer answer) {
		this.answer = answer;
	}

	public UserBranch getUserBranch() {
		return userBranch;
	}

	public void setUserBranch(UserBranch userBranch) {
		this.userBranch = userBranch;
	}

	public PhoneContact getPhoneContact() {
		return phoneContact;
	}

	public void setPhoneContact(PhoneContact phoneContact) {
		this.phoneContact = phoneContact;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPasswordConfirmation() {
		return passwordConfirmation;
	}

	public void setPasswordConfirmation(String passwordConfirmation) {
		this.passwordConfirmation = passwordConfirmation;
	}

	public String getBirthDate() {
		return birthDate;
	}

	public void setBirthDate(String birthDate) {
		this.birthDate = birthDate;
	}

	public String getLastLoginDate() {
		return lastLoginDate;
	}

	public void setLastLoginDate(String lastLoginDate) {
		this.lastLoginDate = lastLoginDate;
	}

	public String getImageURL() {
		return imageURL;
	}

	public void setImageURL(String imageURL) {
		this.imageURL = imageURL;
	}

	public User getBoss() {
		return boss;
	}

	public void setBoss(User boss) {
		this.boss = boss;
	}

	public List<User> getSubordinates() {
		return subordinates;
	}

	public void setSubordinates(List<User> subordinates) {
		this.subordinates = subordinates;
	}

	public UserPrivilage getUserPrivilage() {
		return userPrivilage;
	}

	public void setUserPrivilage(UserPrivilage userPrivilage) {
		this.userPrivilage = userPrivilage;
	}
	
	public String getUserData(){
		return imageURL;
	}
	
	public User getUserClon(){
		return (User)this.clone();
	}
	
	public Object clone(){
        Object obj=null;
        try{
            obj=super.clone();
        }catch(CloneNotSupportedException ex){
            System.out.println(" User object cannot be clonned");
        }
        return obj;
    }

}
